Due to the work on gdk_cursor_new_from_surface (commit
b2113b73),
get_cursor_for_pixbuf() in GdkDisplayClass was converted to
get_cursor_for_surface(), which means the GDK Win32 backend needs to be
updated for the code to build and run on Windows, plus some function
prototypes and declarations/calls need to be updated as well.
https://bugzilla.gnome.org/show_bug.cgi?id=705980
}
GdkPixbuf *
-gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon, gint *x_hot, gint *y_hot)
+gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
+ gdouble *x_hot,
+ gdouble *y_hot)
{
GdkPixbuf *pixbuf = NULL;
ICONINFO ii;
gdouble *y_hot)
{
GdkPixbuf *pixbuf;
- cairo_surface_t *surface
+ cairo_surface_t *surface;
g_return_val_if_fail (cursor != NULL, NULL);
}
GdkCursor *
-_gdk_win32_display_get_cursor_for_pixbuf (GdkDisplay *display,
- GdkPixbuf *pixbuf,
- gint x,
- gint y)
+_gdk_win32_display_get_cursor_for_surface (GdkDisplay *display,
+ cairo_surface_t *surface,
+ gdouble x,
+ gdouble y)
{
HCURSOR hcursor;
+ GdkPixbuf *pixbuf;
+ gint width, height;
g_return_val_if_fail (display == _gdk_display, NULL);
+ g_return_val_if_fail (surface != NULL, NULL);
+
+ width = cairo_image_surface_get_width (surface);
+ height = cairo_image_surface_get_height (surface);
+ pixbuf = gdk_pixbuf_get_from_surface (surface,
+ 0,
+ 0,
+ width,
+ height);
+
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
g_return_val_if_fail (0 <= x && x < gdk_pixbuf_get_width (pixbuf), NULL);
g_return_val_if_fail (0 <= y && y < gdk_pixbuf_get_height (pixbuf), NULL);
hcursor = _gdk_win32_pixbuf_to_hcursor (pixbuf, x, y);
+
+ g_object_unref (pixbuf);
if (!hcursor)
return NULL;
return cursor_new_from_hcursor (hcursor, GDK_CURSOR_IS_PIXMAP);
GdkCursor *cursor);
static void gdk_device_wintab_warp (GdkDevice *device,
GdkScreen *screen,
- gint x,
- gint y);
+ gdouble x,
+ gdouble y);
static void gdk_device_wintab_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
static void
gdk_device_wintab_warp (GdkDevice *device,
GdkScreen *screen,
- gint x,
- gint y)
+ gdouble x,
+ gdouble y)
{
}
//? display_class->get_app_launch_context = _gdk_win32_display_get_app_launch_context;
display_class->get_cursor_for_type = _gdk_win32_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_win32_display_get_cursor_for_name;
- display_class->get_cursor_for_pixbuf = _gdk_win32_display_get_cursor_for_pixbuf;
+ display_class->get_cursor_for_surface = _gdk_win32_display_get_cursor_for_surface;
display_class->get_default_cursor_size = _gdk_win32_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_win32_display_get_maximal_cursor_size;
display_class->supports_cursor_alpha = _gdk_win32_display_supports_cursor_alpha;
GdkCursorType cursor_type);
GdkCursor *_gdk_win32_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
-GdkCursor *_gdk_win32_display_get_cursor_for_pixbuf (GdkDisplay *display,
- GdkPixbuf *pixbuf,
- gint x,
- gint y);
+GdkCursor *_gdk_win32_display_get_cursor_for_surface (GdkDisplay *display,
+ cairo_surface_t *surface,
+ gdouble x,
+ gdouble y);
void _gdk_win32_display_get_default_cursor_size (GdkDisplay *display,
guint *width,
guint *height);
/* For internal GTK use only */
GDK_AVAILABLE_IN_ALL
-GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon);
+GdkPixbuf *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon,
+ gdouble *x_hot,
+ gdouble *y_hot);
GDK_AVAILABLE_IN_ALL
HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
if (hIcon)
{
icon_info = icon_info_new ();
- icon_info->cache_pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon);
+ icon_info->cache_pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL);
DestroyIcon (hIcon);
icon_info->dir_type = ICON_THEME_DIR_UNTHEMED;
icon_info->dir_size = size;